<link rel="stylesheet" href="<?php echo URL::base() ?>media/vendor/css/style.css" type="text/css" media="all" />
<link rel="stylesheet" href="<?php echo URL::base() ?>media/vendor/artdialog/skins/default.css" type="text/css" media="all" />
<link href="<?php echo URL::base() ?>media/vendor/css/ui-lightness/jquery-ui-1.10.4.custom.css" rel="stylesheet">
<script src="<?php echo URL::base() ?>media/vendor/js/jquery-1.10.2.js"></script>
<script src="<?php echo URL::base() ?>media/vendor/js/jquery-ui-1.10.4.custom.js"></script>
<script src="<?php echo URL::base() ?>media/vendor/js/jquery.ui.datepicker-zh-TW.js"></script>
<script src="<?php echo URL::base() ?>media/vendor/js/Validform_v5.3.2_ncr_min.js"></script>
<script src="<?php echo URL::base() ?>media/vendor/artdialog/jquery.artDialog.js"></script>
<script type="text/javascript">
    function get_pandian(url,start_time){
        var dialog = art.dialog({title: '提示',icon:'question',lock: true});
        dialog.content('<p>提交中，请耐心等待约5-10分钟...<p>');
        $.get(
            url,
            {
                start_time:start_time
            },
            function(data){
                if(data){alert(data);
                    dialog.content('<p>对应月份的期末库存已更新，对应的出库单成本已更新<p>');
                   // window.location.reload();
                }
            }
        );
    }
    $(function(){
        $.datepicker.setDefaults({ dateFormat: 'yy-mm' });
        $("#start").datepicker({

        });
        $('.btn').click(function(){
            var start_time=$("#start").val();
            
            if(start_time=='' || start_time<'2014-07'){
                alert('请选择需要的年月且不能小于2014年7月');return false;
            }else{

            url='<?php echo URL::base() ?>mouthlykc/update_kc';
            get_pandian(url,start_time);
            }
        });
    });


</script>
<div class="row">
    <div class="span11">
        <form class="form-horizontal"  >
            <div class="control-group">
                <label style="width:80px;">请选择需要的年月</label>

                    <input type="text" style=" width:164px;"  name='start_date' id='start' class="datepicker"
                           value="" readonly="readonly">

                    <div style="margin-left:5px;" class="btn btn-info" id="save">确定</div>

            </div>
        </form>
    </div>
    <div class="span4">
    </div>
</div>
